<%-- Copyright (c) 2002 BroadVision, Inc. All rights reserved              --%>
<%-- The product described in this manual may be protected by one or more  --%>
<%-- U.S. and International patents. The BroadVision One-To-One software   --%>
<%-- is covered by U.S. patent 5,710,887.                                  --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and the BroadVision logo are registered       --%>
<%-- trademarks, and BroadVision One-To-One is a trademark of BroadVision, --%>
<%-- Inc. IONA and Orbix are trademarks of IONA Technologies, Ltd. RSA,    --%>
<%-- MD5, and RC2 are trademarks of RSA Data Security, Inc. All other      --%>
<%-- trademarks, service marks, and trade names belong to their respective --%>
<%-- owners. BroadVision, Inc. disclaims any proprietary interest in the   --%>
<%-- marks and names of others.                                            --%>
<%--                                                                       --%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/bv-html.tld" prefix="bvhtml"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

<%@ page import="java.util.List" %>
<%@ page import="com.broadvision.emarketing.criteriabuilder.ConditionTreeNode"%>
<%@ page import="com.broadvision.emarketing.criteriabuilder.Tree" %>
<%@ page import="com.broadvision.emarketing.action.Constants"%>

<SCRIPT>

function doAction(action, myform)
{
    myform.action='<html:rewrite page="'+action+'" />';
    myform.submit();
    return true;
}

</SCRIPT>
<c:set var="formBean" value="${emRuleDetailForm}" />
<c:set var="formBeanMap" value="${formBean.map}" />
<table width="100%" border="0" cellspacing="0" cellpadding="0"
	class="zoneFive">	
	
	<tr>
		<td valign="top" width="100%">
		<div class="pageTitle">
			 <bean-el:message bundle="em" key="emarketing.ruleSet.rule.pageTitle.viewRule" arg0="${formBeanMap.ruleName}"/> <br>
		</div>
		
		<div><jsp:include page="/mc/common/pagetab.jsp" /><div>
	
		<div class="pageInstructions">
		</div>

		<html:form action="/em/ruleset/ruleEdit">
		<html:hidden name="emRuleDetailForm" property="ruleSetOid" />
		<html:hidden name="emRuleDetailForm" property="ruleOid" />
		<div class="pageSubtitle">
			<span class="left">
			<bean:message bundle="em" key="emarketing.ruleSet.rule.header.ruleSummary" />
			</span>
			<logic:equal name="emRuleDetailForm" property="editType" value="true">
			<span class="right">
				<input type="button" name="edit" class="inputButton" 
				value="<bean:message bundle="em" key="button.edit"/>" 
				onClick="doAction('/em/ruleset/ruleEdit.do', this.form);" />
			</span>
			</logic:equal>
		</div>
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="labelForm">
				<tr>
					<td><html:errors /></td>
				</tr>
				<tr>
					<td valign="top" wrap class="label" width="30%">
						<bean:message bundle="em" key="emarketing.ruleset.lable.rule.name" />:
					</td>
					<td valign="top" wrap class="labelField" width="70%">
						<bean:write name="emRuleDetailForm" property="ruleName" />
					</td>
				</tr>
				<tr>
					<td valign="top" wrap class="label" width="30%">
						<bean:message bundle="em" key="emarketing.ruleset.lable.rule.description" />:
					</td>
					<td valign="top" wrap class="labelField" width="70%">
						<bean:write name="emRuleDetailForm" property="ruleDescription" />
					</td>
				</tr>
				<tr>
					<td valign="top" wrap class="label" width="30%">
						<bean:message bundle="em" key="emarketing.ruleSet.ruleSetSummary.lable.offerContentType" />:
					</td>
					<td valign="top" wrap class="labelField" width="70%">
						<bean:write name="emRuleDetailForm" property="contentTypeName" />
					</td>
				</tr>
				<tr>
					<td valign="top" wrap class="label" width="30%">
						<bean:message bundle="em" key="emarketing.ruleset.ruleSetEdit.lable.evaluationMethod" />:
					</td>
					<td valign="top" wrap class="labelField" width="70%">
					<logic:equal name="emRuleDetailForm" property="evalMethod" value="ALL" >
						<bean:message bundle="em" key="emarketing.ruleset.ruleSetEdit.lable.evaluateall"/>
					</logic:equal>
					<logic:equal name="emRuleDetailForm" property="evalMethod" value="FIRST" >
						<bean:message bundle="em" key="emarketing.ruleset.ruleSetEdit.lable.evaluatefirst"/>
					</logic:equal>
					</td>
				</tr>
			</table>

			<div class="pageSubtitle">
				<bean:message bundle="em" key="emarketing.ruleSet.rule.lable.eventDateSelection" />
			</div>
            <%
              Tree conditionTree = (Tree)session.getAttribute(Constants.CRITERIA_TREE);
              request.setAttribute("conditionList", conditionTree.getPreorderNodeList(false, false));
            %>
            <jsp:include page="/em/criteriabuilder/conditionListViewSection.jsp" />


			<div class="pageSubtitle">
				<bean:message bundle="em" key="emarketing.ruleSet.rule.header.ruleAction" />
			</div>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="labelForm">
			<logic:equal name="emRuleDetailForm" property="ruleActionType" value="1">
			<tr>
				<td class="label" width="30%">
					<bean:message bundle="em" key="emarketing.ruleset.text.action" />:
				</td>
				<td class="labelField" width="70%">
					<bean:message bundle="em" key="emarketing.ruleset.ruleSetEdit.radio.value.pickOneItem" />
				</td>
			</tr>
			<tr>
				<td class="label" width="30%">
					<bean:message bundle="em" key="emarketing.ruleset.ruleSetView.lable.itemKey" />: 
				</td>
				<td class="labelField" width="70%">					
					<bean:write name="emRuleDetailForm" property="itemKey" />					
				</td>
			</tr>
			</logic:equal>
			<logic:equal name="emRuleDetailForm" property="ruleActionType" value="2">
			<tr>
				<td class="label" width="30%">
					<bean:message bundle="em" key="emarketing.ruleset.text.action" />:
				</td>
				<td class="labelField" width="70%">
					<bean:message bundle="em" key="emarketing.ruleset.ruleSetEdit.radio.value.pickCategory" />
				</td>
			</tr>
			<tr>
				<td class="label" width="30%">
					<bean:message bundle="em" key="emarketing.ruleset.ruleSetEdit.lable.itemsFound" />:
				</td>
				<td class="labelField" width="70%">					
					<bean:write name="emRuleDetailForm" property="categoryPath" />		
					<logic:equal name="emRuleDetailForm" property="includeSubCategory" value="true">
						<bean:message bundle="em" key="emarketing.ruleset.text.includeSubCategories" />
					</logic:equal>			
				</td>
			</tr>
			<tr>
				<td class="label" width="30%">
					<bean:message bundle="em" key="emarketing.ruleset.text.numContents" />:
				</td>
				<td class="labelField" width="70%">	
					<bean:write name="emRuleDetailForm" property="numItems" />
				</td>	
			</tr>
			</logic:equal>
			</table>
			<br>
	</html:form>
	</td>
</tr>
</table>
